﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace RazorPageSample.Pages.Blogs
{
    public class Blog
    {
        public Blog()
        {
            //Id = Guid.NewGuid().ToString("N");
        }
        public Blog(string name)
            :this()
        {
            Name = name;
        }
        public Blog(int id,string name)
            : this()
        {
            Id = id; 
            Name = name;
        }
        public int Id { get; set; }
        public string Name { get; set; }
    }
    public class IndexModel : PageModel
    {
        public IEnumerable<Blog> Blogs { get; set; }
        public void OnGet()
        {
            Blogs = new List<Blog>() {
               new Blog(1,"gainorloss"),
               new Blog(2,"gain"),
               new Blog(3,"Zhang Jian"),
            };
        }
    }
}